package se.penselnsvag.bookdb.tech.log.formater {
	import se.penselnsvag.bookdb.tech.log.LogMessage;
	
	

/**
* VerboseFormater,
*
* Formater public class for formating LogMessages with all data in LogMessage.
*
* Author:christian.vejrich@gimlet.se
* Date: 2006-02-23
* Version: 1.0
* History: -
*/


public class VerboseFormater implements IFormater
{
	public function VerboseFormater(){}
	
	private static var instance:IFormater = null;
	
	public static function getInstance() : IFormater
	{
		if(instance==null || instance==undefined)
		{
			instance = new VerboseFormater();	
		}
		return instance;
	}
	
	public function format(logMessage:LogMessage) : String
	{
		var str : String = "" + logMessage.getLogTimeStamp();
		str += " : " + logMessage.getLogLevelName();
		str += " : " + logMessage.getLogClassName();
		str += " : " + logMessage.getLogMethodName();
		str += " : " + logMessage.getLogMessage();
		str += (logMessage.getLogException()==null || logMessage.getLogException()==undefined)? 
		" " : " : " +logMessage.getLogException().toString();
		
		return str;
	}		
}
}